<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="LMS培训班管理系统 管理平台" />
    <meta name="author" content="" />

    <title>LMS培训班管理系统 管理平台</title>

    <link rel="stylesheet" href="/LMS/Public/assets/css/fonts/linecons/css/linecons.css">
    <link rel="stylesheet" href="/LMS/Public/assets/css/fonts/fontawesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/LMS/Public/assets/css/bootstrap.css">
    <link rel="stylesheet" href="/LMS/Public/assets/css/xenon-core.css">
    <link rel="stylesheet" href="/LMS/Public/assets/css/xenon-forms.css">
    <link rel="stylesheet" href="/LMS/Public/assets/css/xenon-components.css">
    <link rel="stylesheet" href="/LMS/Public/assets/css/xenon-skins.css">
    <link rel="stylesheet" href="/LMS/Public/assets/css/custom.css">

    <script src="/LMS/Public/assets/js/jquery-1.11.1.min.js"></script>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->


</head>
<body class="page-body skin-concrete">
<div class="page-container"><!-- add class "sidebar-collapsed" to close sidebar by default, "chat-visible" to make chat appear always -->

    <!-- Add "fixed" class to make the sidebar fixed always to the browser viewport. -->
    <!-- Adding class "toggle-others" will keep only one menu item open at a time. -->
    <!-- Adding class "collapsed" collapse sidebar root elements and show only icons. -->
    <div class="sidebar-menu toggle-others fixed">

        <div class="sidebar-menu-inner">

            <header class="logo-env">

                <!-- logo -->
                <div class="logo">
                    <a href="<?php echo U('/Admin/','','');?>" class="logo-expanded">
                        <img src="assets/images/logo@2x.png" width="80" alt="" />管理平台
                    </a>

                    <a href="<?php echo U('/Admin/','','');?>" class="logo-collapsed">
                        <img src="assets/images/logo-collapsed@2x.png" width="40" alt="" />管理
                    </a>
                </div>

                <!-- This will toggle the mobile menu and will be visible only on mobile devices -->
                <div class="mobile-menu-toggle visible-xs">
                    <a href="#" data-toggle="user-info-menu">
                        <i class="fa-bell-o"></i>
                        <span class="badge badge-success">0</span>
                    </a>

                    <a href="#" data-toggle="mobile-menu">
                        <i class="fa-bars"></i>
                    </a>
                </div>

            </header>

            <ul id="main-menu" class="main-menu">
                <!-- add class "multiple-expanded" to allow multiple submenus to open -->
                <!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" -->
                <?php if(is_array($menu)): foreach($menu as $mk=>$mo): ?><li <?php echo ($mo['menu_class']); ?>>
        <a href="<?php echo U($mk.'/Index','','');?>">
            <i class="<?php echo ($mo[1]); ?>"></i>
            <span class="title"><?php echo ($mo[0]); ?></span>
        </a>
        <ul>
            <?php if(is_array($mo['sub'])): foreach($mo['sub'] as $key=>$smo): ?><li <?php echo ($smo['sub_class']); ?>>
                <a href="<?php echo U($smo['url'],'','');?>">
                    <span class="title"><?php echo ($smo['subname']); ?></span>
                </a>
            </li><?php endforeach; endif; ?>
        </ul>
    </li><?php endforeach; endif; ?>


            </ul>
        </div>
    </div>

    <div class="main-content">
        <!-- User Info, Notifications and Menu Bar -->
        <nav class="navbar user-info-navbar" role="navigation">

            <!-- Left links for user info navbar -->
            <ul class="user-info-menu left-links list-inline list-unstyled">

                <li class="hidden-sm hidden-xs">
                    <a href="#" data-toggle="sidebar">
                        <i class="fa-bars"></i>
                    </a>
                </li>

                <li class="dropdown hover-line">
                    <a href="#" data-toggle="dropdown">
                        <i class="fa-envelope-o"></i>
                        <span class="badge badge-green">15</span>
                    </a>

                    <ul class="dropdown-menu messages">
                        <li>

                            <ul class="dropdown-menu-list list-unstyled ps-scrollbar">

                                <li class="active"><!-- "active" class means message is unread -->
                                    <a href="#">
											<span class="line">
												<strong>Luc Chartier</strong>
												<span class="light small">- yesterday</span>
											</span>

											<span class="line desc small">
												This ain’t our first item, it is the best of the rest.
											</span>
                                    </a>
                                </li>

                                <li class="active">
                                    <a href="#">
											<span class="line">
												<strong>Salma Nyberg</strong>
												<span class="light small">- 2 days ago</span>
											</span>

											<span class="line desc small">
												Oh he decisively impression attachment friendship so if everything.
											</span>
                                    </a>
                                </li>

                                <li>
                                    <a href="#">
											<span class="line">
												Hayden Cartwright
												<span class="light small">- a week ago</span>
											</span>

											<span class="line desc small">
												Whose her enjoy chief new young. Felicity if ye required likewise so doubtful.
											</span>
                                    </a>
                                </li>

                                <li>
                                    <a href="#">
											<span class="line">
												Sandra Eberhardt
												<span class="light small">- 16 days ago</span>
											</span>

											<span class="line desc small">
												On so attention necessary at by provision otherwise existence direction.
											</span>
                                    </a>
                                </li>

                                <!-- Repeated -->

                                <li class="active"><!-- "active" class means message is unread -->
                                    <a href="#">
											<span class="line">
												<strong>Luc Chartier</strong>
												<span class="light small">- yesterday</span>
											</span>

											<span class="line desc small">
												This ain’t our first item, it is the best of the rest.
											</span>
                                    </a>
                                </li>

                                <li class="active">
                                    <a href="#">
											<span class="line">
												<strong>Salma Nyberg</strong>
												<span class="light small">- 2 days ago</span>
											</span>

											<span class="line desc small">
												Oh he decisively impression attachment friendship so if everything.
											</span>
                                    </a>
                                </li>

                                <li>
                                    <a href="#">
											<span class="line">
												Hayden Cartwright
												<span class="light small">- a week ago</span>
											</span>

											<span class="line desc small">
												Whose her enjoy chief new young. Felicity if ye required likewise so doubtful.
											</span>
                                    </a>
                                </li>

                                <li>
                                    <a href="#">
											<span class="line">
												Sandra Eberhardt
												<span class="light small">- 16 days ago</span>
											</span>

											<span class="line desc small">
												On so attention necessary at by provision otherwise existence direction.
											</span>
                                    </a>
                                </li>

                            </ul>

                        </li>

                        <li class="external">
                            <a href="blank-sidebar.html">
                                <span>All Messages</span>
                                <i class="fa-link-ext"></i>
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="dropdown hover-line">
                    <a href="#" data-toggle="dropdown">
                        <i class="fa-bell-o"></i>
                        <span class="badge badge-purple">7</span>
                    </a>

                    <ul class="dropdown-menu notifications">
                        <li class="top">
                            <p class="small">
                                <a href="#" class="pull-right">Mark all Read</a>
                                You have <strong>3</strong> new notifications.
                            </p>
                        </li>

                        <li>
                            <ul class="dropdown-menu-list list-unstyled ps-scrollbar">
                                <li class="active notification-success">
                                    <a href="#">
                                        <i class="fa-user"></i>

											<span class="line">
												<strong>New user registered</strong>
											</span>

											<span class="line small time">
												30 seconds ago
											</span>
                                    </a>
                                </li>

                                <li class="active notification-secondary">
                                    <a href="#">
                                        <i class="fa-lock"></i>

											<span class="line">
												<strong>Privacy settings have been changed</strong>
											</span>

											<span class="line small time">
												3 hours ago
											</span>
                                    </a>
                                </li>

                                <li class="notification-primary">
                                    <a href="#">
                                        <i class="fa-thumbs-up"></i>

											<span class="line">
												<strong>Someone special liked this</strong>
											</span>

											<span class="line small time">
												2 minutes ago
											</span>
                                    </a>
                                </li>

                                <li class="notification-danger">
                                    <a href="#">
                                        <i class="fa-calendar"></i>

											<span class="line">
												John cancelled the event
											</span>

											<span class="line small time">
												9 hours ago
											</span>
                                    </a>
                                </li>

                                <li class="notification-info">
                                    <a href="#">
                                        <i class="fa-database"></i>

											<span class="line">
												The server is status is stable
											</span>

											<span class="line small time">
												yesterday at 10:30am
											</span>
                                    </a>
                                </li>

                                <li class="notification-warning">
                                    <a href="#">
                                        <i class="fa-envelope-o"></i>

											<span class="line">
												New comments waiting approval
											</span>

											<span class="line small time">
												last week
											</span>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        <li class="external">
                            <a href="#">
                                <span>View all notifications</span>
                                <i class="fa-link-ext"></i>
                            </a>
                        </li>
                    </ul>
                </li>

            </ul>


            <!-- Right links for user info navbar -->
            <ul class="user-info-menu right-links list-inline list-unstyled">

                <li class="dropdown user-profile">
                    <a href="#" data-toggle="dropdown">
                        <img src="/LMS/Public/assets/images/user-1.png" alt="user-image" class="img-circle img-inline userpic-32" width="28" />
						<span>
							<?php echo ($nickname); ?>
							<i class="fa-angle-down"></i>
						</span>
                    </a>

                    <ul class="dropdown-menu user-profile-menu list-unstyled">
                        <li>
                            <a href="<?php echo U('User/ChangePwd','','');?>">
                                <i class="fa-wrench"></i>
                                修改密码
                            </a>
                        </li>
                        <li>
                            <a href="<?php echo U('User/ShowUser',array('id' => session('Admin')['UserID']),'');?>">
                                <i class="fa-user"></i>
                                个人信息
                            </a>
                        </li>
                        <li class="last">
                            <a href="<?php echo U('Common/Logout','','');?>">
                                <i class="fa-lock"></i>
                                注销登录
                            </a>
                        </li>
                    </ul>
                </li>

            </ul>

        </nav>

        <div class="page-title">

            <div class="title-env">
                <h1 class="title"><?php echo ((isset($title) && ($title !== ""))?($title):"主页面"); ?></h1>
                <p class="description"><?php echo ($titleDesc); ?></p>
            </div>

            <div class="breadcrumb-env">
                <!--
                                <ol class="breadcrumb bc-1">
                                    <li>
                                        <a href="<?php echo U('/Admin/','','');?>"><i class="fa-home"></i>首页</a>
                                    </li>
                                    <li>
                                        <a href="#">栏目</a>
                                    </li>
                                    <li class="active">
                                        <strong>项目</strong>
                                    </li>
                                </ol>
                -->
            </div>
        </div>

        <div class="panel panel-default">
    <div class="panel-heading">
        搜索条件
    </div>
    <div class="panel-body">
        <div class="form-group">
            <div class="row">
                <div class="col-md-2">报名开始时间:</div>
                <div class="col-md-2">
                    <div class="input-group">
                        <input type="text" name="RegistrationStartTime" id="RegistrationStartTime"
                               class="form-control datetimepicker">
                        <span class="input-group-btn">
                            <button class="btn btn-gray" type="button"
                                    onclick="javascript: $('#RegistrationStartTime').val('');">
                                <i class="glyphicon glyphicon-remove"></i>
                            </button>
                        </span>
                    </div>
                </div>
                <div class="col-md-2">报名结束时间:</div>
                <div class="col-md-2">
                    <div class="input-group">
                        <input type="text" name="RegistrationEndTime" id="RegistrationEndTime"
                               class="form-control datetimepicker">
                        <span class="input-group-btn">
                            <button class="btn btn-gray" type="button"
                                    onclick="javascript: $('#RegistrationEndTime').val('');">
                                <i class="glyphicon glyphicon-remove"></i>
                            </button>
                        </span>
                    </div>
                </div>
                <div class="col-md-1">名称:</div>
                <div class="col-md-3"><input type="text" name="ClassName" id="ClassName" class="form-control">
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="row">
                <div class="col-md-2">培训开始时间:</div>
                <div class="col-md-2">
                    <div class="input-group">
                        <input type="text" name="StartTime" id="StartTime"
                               class="form-control datetimepicker">
                        <span class="input-group-btn">
                            <button class="btn btn-gray" type="button"
                                    onclick="javascript: $('#StartTime').val('');">
                                <i class="glyphicon glyphicon-remove"></i>
                            </button>
                        </span>
                    </div>
                </div>
                <div class="col-md-2">培训结束时间:</div>
                <div class="col-md-2">
                    <div class="input-group">
                        <input type="text" name="EndTime" id="EndTime"
                               class="form-control datetimepicker">
                        <span class="input-group-btn">
                            <button class="btn btn-gray" type="button"
                                    onclick="javascript: $('#EndTime').val('');">
                                <i class="glyphicon glyphicon-remove"></i>
                            </button>
                        </span>
                    </div>
                </div>
                <div class="col-md-1">状态:</div>
                <div class="col-md-3">
                    <div class="row">
                        <div class="col-md-6">
                            <select name="IsOpen" id="IsOpen" class="form-control">
                                <option value="">全部</option>
                                <option value="1">开放</option>
                                <option value="0">关闭</option>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <input type="button" value="搜索" class="btn btn-info" id="btnSearch">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-body">
        <table id="list" class="table table-striped table-bordered" cellspacing="0" width="100%">
            <thead>
            <tr>
                <th></th>
                <th>培训班名称</th>
                <th>报名时段</th>
                <th>培训时段</th>
                <th>状态</th>
                <th>培训费</th>
                <th>可选课数</th>
                <th></th>
            </tr>
            </thead>

            <tbody>

            </tbody>
        </table>
    </div>
</div>

<script>
    $(function () {
        var regConfig = {
            language: 'cn',
            separator: ' 至 ',
            format: 'YYYY年MM月DD日 HH:mm',
            autoClose: false,
            time: {
                enabled: true
            },
            getValue: function () {
                if ($('#RegistrationStartTime').val() && $('#RegistrationEndTime').val())
                    return $('#RegistrationStartTime').val() + ' 至 ' + $('#RegistrationEndTime').val();
                else
                    return '';
            },
            setValue: function (s, s1, s2) {
                $('#RegistrationStartTime').val(s1);
                $('#RegistrationEndTime').val(s2);
            }
        };

        var Config = {
            language: 'cn',
            separator: ' 至 ',
            format: 'YYYY年MM月DD日 HH:mm',
            autoClose: false,
            time: {
                enabled: true
            },
            getValue: function () {
                if ($('#StartTime').val() && $('#EndTime').val())
                    return $('#StartTime').val() + ' 至 ' + $('#EndTime').val();
                else
                    return '';
            },
            setValue: function (s, s1, s2) {
                $('#StartTime').val(s1);
                $('#EndTime').val(s2);
            }
        };

        $('#RegistrationStartTime').dateRangePicker(regConfig);
        $('#RegistrationEndTime').dateRangePicker(regConfig);

        $('#StartTime').dateRangePicker(Config);
        $('#EndTime').dateRangePicker(Config);

        $('#list').dataTable({
            "lengthMenu": [[10, 25, 50, 100], [10, 25, 50, 100]], //分页控制
            "pageLength": 10,//首次加载的数据条数
            "order": [[2, "desc"]],   //默认排序
            "createdRow": function (row, data, index) {
                //row 行对象,data 数据对象,index行索引
                if (data['isopen'] == 1) {
                    $('td', row).eq(4).css('font-weight', "bold").css("color", "red");
                }
                $('td', row).eq(2).html(data['RegStartTime'] + ' 至 ' + data['RegEndTime']);
                $('td', row).eq(3).html(data['StartTime'] + ' 至 ' + data['EndTime']);
            },
            "dom": '<"top"l>rt<"bottom"ip><"clear">',
            "columnDefs": [
                // 增加一列，包括删除和修改，同时将需要传递的数据传递到链接中
                {
                    "targets": [0], // 目标列位置，下标从0开始
                    "searchable": false,
                    "orderable": false,
                    "data": "id", // 数据列名
                    "render": function (data, type, full) { // 返回自定义内容
                        return "<input type='checkbox'>";
                    }
                },
                // 增加一列，包括删除和修改，同时将需要传递的数据传递到链接中
                {
                    "targets": [7], // 目标列位置，下标从0开始
                    "searchable": false,
                    "orderable": false,
                    "data": "id", // 数据列名
                    "render": function (data, type, full) { // 返回自定义内容
                        return "<div class=\"btn-group\">" +
                        "<button type=\"button\" class=\"btn btn-g dropdown-toggle\" data-toggle=\"dropdown\">" +
                        "操作 <span class=\"caret\"></span>" +
                        "</button>" +
                        "<ul class=\"dropdown-menu\" role=\"menu\">" +
                        "<li>" +
                        "<a href='<?php echo U('Add','','');?>?id=" + data + "'>编辑</a>" +
                        "</li>" +
                        "<li>" +
                        "<a href='<?php echo U('CourseRelation','Course','');?>?id=" + data + "'>关联课程</a>" +
                        "</li>" +
                        "<li>" +
                        "<a onclick='return confirm(\"你确认要删除么？\");' href='<?php echo U('delete','','');?>?id=" + data + "'>删除</a>" +
                        "</li>" +
                        "</ul>" +
                        "</div>";
                    }
                }
            ],
            "language": {
                "sProcessing": "处理中...",
                "sLengthMenu": "显示 _MENU_ 条记录",
                "sZeroRecords": "没有匹配结果",
                "sInfo": "显示第 _START_ 至 _END_ 条记录，共 _TOTAL_ 条",
                "sInfoEmpty": "显示第 0 至 0 条记录，共 0 条",
                "sInfoFiltered": "(由 _MAX_ 条结果过滤)",
                "sInfoPostFix": "",
                "sSearch": "搜索:",
                "sUrl": "",
                "sEmptyTable": "表中数据为空",
                "sLoadingRecords": "载入中...",
                "sInfoThousands": ",",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上页",
                    "sNext": "下页",
                    "sLast": "末页"
                },
                "oAria": {
                    "sSortAscending": ": 以升序排列此列",
                    "sSortDescending": ": 以降序排列此列"
                }
            },
            "processing": true,//分页，取数据等等的都放到服务端去
            "serverSide": true,//载入数据的时候是否显示“载入中”
            "columns": [
                {},
                {"data": "classname"},
                {"data": "registrationstarttime"},
                {"data": "starttime"},
                {"data": "IsOpenDesc"},
                {"data": "trainingcost"},
                {"data": "allownumberofcourses"},
                {"width": "10%"}
            ],
            "ajax": {
                "url": "<?php echo U('Class/GetData','','');?>",
                "type": "post"
            },
        });

        //搜索按钮
        $("#btnSearch").on('click', function () {
            var className = $("#ClassName").val();
            var regBeginTime = $("#RegistrationStartTime").val();
            var regEndTime = $("#RegistrationEndTime").val();
            var beginTime = $("#StartTime").val();
            var endTime = $("#EndTime").val();
            var isOpen = $("#IsOpen").val();

            $('#list').DataTable().column(1).search(className)
                    .column(2).search(regBeginTime + '|' + regEndTime)
                    .column(3).search(beginTime + '|' + endTime)
                    .column(4).search(isOpen).draw();
        });
    });
</script>

        <!-- Main Footer -->
        <!-- Choose between footer styles: "footer-type-1" or "footer-type-2" -->
        <!-- Add class "sticky" to  always stick the footer to the end of page (if page contents is small) -->
        <!-- Or class "fixed" to  always fix the footer to the end of page -->
        <footer class="main-footer sticky footer-type-1">

            <div class="footer-inner">

                <!-- Add your copyright text here -->
                <div class="footer-text">
                    &copy; 2015
                    <strong>luckynet</strong>
                </div>


                <!-- Go to Top Link, just add rel="go-top" to any link to add this functionality -->
                <div class="go-up">
                    <a href="#" rel="go-top">
                        <i class="fa-angle-up"></i>
                    </a>
                </div>

            </div>
        </footer>
    </div>

</div>

<!-- For datatables css -->
<link rel="stylesheet" href="/LMS/Public/assets/js/datatables/dataTables.bootstrap.css">
<link rel="stylesheet" href="/LMS/Public/assets/js/datatables/css/jquery.dataTables.css">

<!-- Bottom Scripts -->
<script src="/LMS/Public/assets/js/bootstrap.min.js"></script>
<script src="/LMS/Public/assets/js/TweenMax.min.js"></script>
<script src="/LMS/Public/assets/js/resizeable.js"></script>
<script src="/LMS/Public/assets/js/joinable.js"></script>
<script src="/LMS/Public/assets/js/xenon-api.js"></script>
<script src="/LMS/Public/assets/js/xenon-toggles.js"></script>
<script src="/LMS/Public/assets/js/jquery-validate/jquery.validate.min.js"></script>
<!-- For datatables javascript -->
<script src="/LMS/Public/assets/js/datatables/js/jquery.dataTables.min.js"></script>
<script src="/LMS/Public/assets/js/datatables/dataTables.bootstrap.js"></script>
<!-- For datarangepicker -->
<link rel="stylesheet" href="/LMS/Public/vendor/jquery-date-range-picker/daterangepicker.css" />
<script src="/LMS/Public/vendor/jquery-date-range-picker/moment.min.js"></script>
<script src="/LMS/Public/vendor/jquery-date-range-picker/jquery.daterangepicker.js"></script>

<!-- JavaScripts initializations and stuff -->
<script src="/LMS/Public/assets/js/xenon-custom.js"></script>

</body>
</html>